"""
元组
元组的元素是无法修改的
"""

import sys

t = ('Ben', 38, True, 'NewYork')
print('t = ', t, end='\n')
# 获取元组中的元素
print('t[3] = ', t[3], end='\n')
# 遍历元组中的值
for v in t:
    print('v = ', v, end='\n')

# 元组不支持直接赋值
# t[0] = 'Scott'

# 转为列表
ll = list(t)
print('ll = ', ll, end='\n')
print('ll size = ', sys.getsizeof(ll), end='\n')
# 列表转为元组
print('ll = ', tuple(ll), end='\n')
print('ll tuple size = ', sys.getsizeof(tuple(ll)), end='\n')

t = (10)
print(type(t))

t = (10,)
print(type(t))

